<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<style>
.btn_un
{
	cursor:pointer;
	color:white;
	width:68px;
	height:24px;
	border:0px;
	background-image: url(${pageContext.request.contextPath}/images/speedreport/btn_save_un.png);
}

.btn_nu
{
	cursor:pointer;
	color:white;
	width:68px;
	height:24px;
	border:0px;
	background-image: url(${pageContext.request.contextPath}/images/speedreport/btn_save_nu.png);
}

.spread_un
{
	vertical-align: bottom;
	background-image: url("");
	width: 61px; 
	height: 22px
}

.spread_nu
{
	vertical-align: bottom;
	background-image: url("${pageContext.request.contextPath}/images/speedreport/mousemove_bg.png");
	width: 61px; 
	height: 22px;
	color: white;
}

</style>
<script type="text/javascript">

	$(function(){
	    //增加隔行变色效果
        $(".listtable").zebra(); 

		//指标名称
		$('#dqm_dataestimatecal_kqinameinputedit_liuhao_kpiname').combogrid({
			url:'${pageContext.request.contextPath}/mininganalysis/dataEstimateCalAction!getAllKqiName.action',
			panelWidth: 500,
			panelHeight:270,
			pagination:true,
			pageList: [10,20,30],
			required: true,
			idField: 'kqiid',
			textField: 'kqiname',
			value:'${dataEstimateCalModel.kqiid}',
			nowrap:true,
			fitColumns:true,
			columns: [[
						{field:'kqiid',title:'指标编码',width:50},
						{field:'kqiname',title:'指标名称',width:100},
						{field:'kqiversionnum',title:'指标版本号',width:300,resizable:true}
					]],
		    onSelect:function(value,rowData,rowIndex){
		    	
		    	$("#dqm_dataestimatecal_kqiidinputedit").val(rowData.kqiid);
		    	$("#dqm_dataestimatecal_kqiversionnuminputedit").val(rowData.kqiversionnum);
		    }
			//给"指标编码"这个文本域赋值
		
			
		});
		//模型

		$('#dqm_dataestimatecal_modelnameinputedit').combogrid({
			url:'${pageContext.request.contextPath}/mininganalysis/dataEstimateCalAction!getAllDataminingModel.action', 
			panelWidth: 500,
			panelHeight:270,
			editable:true,
			idField: 'dataminimodelId',
			textField: 'dataminimodelName',
			value:'${dataEstimateCalModel.dataminimodelId}',
			required: true,
			fitColumns:true,
			columns: [[
						{field:'dataminimodelId',title:'模型编号',width:70},
						{field:'dataminimodelName',title:'模型名称',width:70},
						{field:'dataminiFormula',title:'模型公式',width:300,editor:'text'},
					]],
			onSelect:function(value,rowData,rowIndex){					    	
					   $("#dqm_dataestimatecal_modelidinputedit").val(rowData.dataminimodelId);
					   $("#dqm_dataestimatecal_formularinputedit").val(rowData.dataminiFormula);
					 }	
	
		});
		
		
	});
	
	function modify()
	{
		var d = $('#dqm_accuracyruleconf_editdialog');
		//form表单提交 
		$('#dqm_dataestimatecal_editform').form('submit', {
			url : '${pageContext.request.contextPath}/mininganalysis/dataEstimateCalAction!updateDataestimatecal.action?estimateId='+${dataEstimateCalModel.estimateId},
			success : function(result) {
				try {
					var r = $.parseJSON(result);
					$.messager.show({
						title : '提示',
						msg : r.returnMsg
					});
					d.dialog('close');
					if (r.returnFlag) {
						$("#dqm_dataestimatecal_listtab").datagrid('reload');
					}
				} catch (e) {
				
					$.messager.alert('提示', result);
					d.dialog('colse');
				}
			}
		});
	}
</script>
<div class="" style="width:100%;height:100%">
<form id="dqm_dataestimatecal_editform" method="post">
	<div id="dqm_dataestimatecal_beforesavebtndivedit" data-options="region:'north'" style="overflow-y:hidden;width:100%;height:100%;">
	<table  class="listtable"  height:0px border="0" cellpadding="0" cellspacing="0" style="width:100%;height:100%;background-image: url(${pageContext.request.contextPath}/images/speedreport/add_speedreport_bg.png)">
		<tr>
			<td height="28px" style="text-align:right;">指标名称:&nbsp;</td>
			<td height="28px">
				<input id="dqm_dataestimatecal_kqinameinputedit_liuhao_kpiname" type="text" name="kqiname" >
			</td>
			<td height="28px" style="text-align:right;">模型名称:&nbsp;</td>
			<td height="28px">
				<input id="dqm_dataestimatecal_modelnameinputedit" type="text" name="dataminimodelName" panelHeight="auto"/>
			</td>
		</tr>
		
		<tr>
			<td height="28px" style="text-align:right">指标编码:&nbsp;</td>
			<td height="28px">
				<input id="dqm_dataestimatecal_kqiidinputedit" name="kqiid" type="text"/>
			</td>
			<td height="28px" style="text-align:right">模型编码:&nbsp;</td>
			<td height="28px">
				<input id="dqm_dataestimatecal_modelidinputedit" type="text"  name="dataminimodelId" panelHeight="auto"/>
			</td>
		</tr>
		
		<tr>
			<td height="28px" style="text-align:right">指标版本号:&nbsp;</td>
			<td height="28px">
				<input id="dqm_dataestimatecal_kqiversionnuminputedit" type="text" name="kqiversionnum"/>
			</td>

			<td height="28px" style="text-align:right">评估状态:&nbsp;</td>
	 	     <td height="28px">
	 	       <select id="dqm_dataestimatecal_estimatestateinputedit" name="estimatestate" class="selectkpiClass" >
	 	          <option value='1'>启用</option>
	 	          <option value='0'>不启用</option>
	 	       </select>
	 	     </td>			
		</tr>
		<tr>
			<td height="28px" style="text-align:right">挖掘模型公式:&nbsp;</td>
			<td height="68px" colspan="3">
				<textarea id="dqm_dataestimatecal_formularinputedit" style="width:92%;height:60px;border-color:#79c0f1"></textarea>
			</td>
		</tr>
		<tr>	
		  <td colspan="6" align="right" height="28px">
			<div id="dqm_dataestimatecal_beforesavebtndivedit" style="float:right"><input id="dqm_dataestimatecal_beforesavebtnedit" onclick="modify()" height="24px" width="64px" type="button" value="保  存" class="btn_un">&nbsp;&nbsp;&nbsp;&nbsp;</div>		
		</tr>
	</table>
	</div>
	</form>
</div>
